package com.molichuxing.services.property;

public enum PyIdverifyTreatResultEnum {
	
	/**
     * 查得
     */
	CHAD(1, "查得"),
	
	/**
	 * 未查得
	 */
	DID_NOT_CHECK(2, "未查得"),
	
	/**
     * 其它原因未查得
     */
	OTHER_REASONS(3, "其它原因未查得");

	Integer value;
    String name;

    PyIdverifyTreatResultEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    /**
     * 通过value获取枚举的name
     *
     * @param value
     * @return
     */
    public static String getName(Integer value) {
    	if(value == null) {
    		return null;
    	}
        PyIdverifyTreatResultEnum enumerate = getEnum(value);
        return enumerate == null ? null : enumerate.getName();
    }

    /**
     * 通过value获取枚举
     *
     * @param value
     * @return
     */
    public static PyIdverifyTreatResultEnum getEnum(Integer value) {
        for (PyIdverifyTreatResultEnum enumerate : PyIdverifyTreatResultEnum.values()) {
            	if(enumerate.getValue() == value ){
            		 return enumerate;
            	}
        }
        return null;
    }
}
